<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>DeathGhost-注册</title>
<meta name="keywords" content="王军校,王军校.cn,web前端设,移动WebApp开发" />
<meta name="description" content="王军校.cn::H5 WEB前端设计开发!" />
<meta name="author" content="王军校"/>
<link href="style/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/public.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jqpublic.js"></script>
<script type="text/javascript" src="js/api.js"></script>
<!--
Author: 王军校
Author URI: http://www.deathghost.cn
-->
</head>

<body>
<header>
 <section class="Topmenubg">
  <div class="Topnav">
   <div class="LeftNav">
    <a href="register.html">注册</a>/<a href="login.html">登录</a><a href="#">QQ客服</a><a href="#">微信客服</a><a href="#">手机客户端</a>
   </div>
   <div class="RightNav">
    <a href="user_center.html">用户中心</a> <a href="user_orderlist.html" target="_blank" title="我的订单">我的订单</a> <a href="cart.html">购物车（0）</a> <a href="user_favorites.html" target="_blank" title="我的收藏">我的收藏</a> <a href="#">商家入驻</a>
   </div>
  </div>
 </section>
 <div class="Logo_search">
  <div class="Logo">
   <img src="images/logo.jpg" title="王军校" alt="模板">
   <i></i>
   <span>西安市 [ <a href="#">莲湖区</a> ]</span>
  </div>
  <div class="Search"> 
   <form method="get" id="main_a_serach" onsubmit="return check_search(this)">
   <div class="Search_nav" id="selectsearch">
    <a href="javascript:;" onClick="selectsearch(this,'restaurant_name')" class="choose">餐厅</a>
    <a href="javascript:;" onClick="selectsearch(this,'food_name')">食物名</a>
   </div>
   <div class="Search_area"> 
   <input type="search" id="fkeyword" name="keyword" placeholder="请输入您所需查找的餐厅名称或食物名称..." class="searchbox" />
   <input type="submit" class="searchbutton" value="搜 索" />
   </div>
   </form>
   <p class="hotkeywords"><a href="#" title="酸辣土豆丝">酸辣土豆丝</a><a href="#" title="这里是产品名称">螃蟹炒年糕</a><a href="#" title="这里是产品名称">牛奶炖蛋</a><a href="#" title="这里是产品名称">芝麻酱凉面</a><a href="#" title="这里是产品名称">滑蛋虾仁</a><a href="#" title="这里是产品名称">蒜汁茄子</a></p>
  </div>
 </div>
 <nav class="menu_bg">
  <ul class="menu">
   <li><a href="index.html">首页</a></li>
   <li><a href="list.html">订餐</a></li>
   <li><a href="category.html">积分商城</a></li>
   <li><a href="article_read.html">关于我们</a></li>
  </ul>
 </nav>
</header>
<!--Start content-->
<section class="Psection MT20">
 <form id="registForm">
 
  <table class="Register">
  <tr>
  <td width="40%" align="right" class="FontW">手机号：</td>
  <td><input type="text" name="appUser.username" pattern="[0-9]{11}" id="username"></td>
  </tr>
  <tr>
  <td width="40%" align="right" class="FontW">密码：</td>
  <td><input type="password" name="appUser.password" id="password"></td>
  </tr>
  <tr>
  <td width="40%" align="right" class="FontW">再次确认：</td>
  <td><input type="password" name="" id="password2"></td>
  </tr>
  <tr>
  <td width="40%" align="right" class="FontW">用户名：</td>
  <td><input type="text" name="appUser.fullname"></td>
  </tr>
  
  <tr>
	  <td width="40%" align="right" class="FontW">你是：</td>
	  <td>
		  <select name="appUser.roleType">
		  	<option value=10>普通用户</option>
		  	<option value=9>商家</option>
		  </select>
	  </td>
  </tr>
  <tr>
	  <td width="40%" align="right" class="FontW">性别：</td>
	  <td>
		  <select name="appUser.title">
		  	<option  value=1>男</option>
		  	<option  value=0>女</option>
		  </select>
	  </td>
  </tr>
  
  <td width="40%" align="right" class="FontW">住址：</td>
  <td><input type="text" name="appUser.address"></td>
  </tr>

  <tr>
  <td width="40%" align="right"></td>
  <td><input type="button" onclick="update()" class="Submit_b" value="注 册">( 已经是会员，<a href="login.html" class="BlueA">请登录</a> )</td>
  </tr>
  </table>
  <input type="hidden" name="appUser.userId">
  <input type="hidden" name="appUser.zhicheng">
  <input type="hidden" name="appUser.photo">
  <input type="hidden" name="appUser.jiaoyanshi">
  <input type="hidden" name="appUser.userSn">
  <input type="hidden" name="appUser.status" value=1>
  <input type="hidden" name="roleIds">
  <input type="hidden" name="appUser.phone"></td>
  <input type="hidden" name="orgIds" value='[{"orgId":"2","orgName":"\u9662\u9886\u5bfc","isPrimary":1,"id":"extModel284-1"}]'>
  
 </form>
</section>
<!--End content-->
<div class="F-link">
  <span>友情链接：</span>   
  <a href="http://www.deathghost.cn" target="_blank" title="王军校">王军校</a>
  <a href="http://www.17sucai.com/pins/15966.html" target="_blank" title="免费后台管理模板">绿色清爽版通用型后台管理模板免费下载</a>
  <a href="http://www.17sucai.com/pins/17567.html" target="_blank" title="果蔬菜类模板源码">HTML5果蔬菜类模板源码</a>
  <a href="http://www.17sucai.com/pins/14931.html" target="_blank" title="黑色的cms商城网站后台管理模板">黑色的cms商城网站后台管理模板</a>
 </div>
<footer>
 <section class="Otherlink">
  <aside>
   <div class="ewm-left">
    <p>手机扫描二维码：</p>
    <img src="images/Android_ico_d.gif">
    <img src="images/iphone_ico_d.gif">
   </div>
   <div class="tips">
    <p>客服热线</p>
    <p><i>1830927**73</i></p>
    <p>配送时间</p>
    <p><time>09：00</time>~<time>22:00</time></p>
    <p>网站公告</p>
   </div>
  </aside>
  <section>
    <div>
    <span><i class="i1"></i>配送支付</span>
    <ul>
     <li><a href="article_read.html" target="_blank" title="标题">支付方式</a></li>
     <li><a href="article_read.html" target="_blank" title="标题">配送方式</a></li>
     <li><a href="article_read.html" target="_blank" title="标题">配送效率</a></li>
     <li><a href="article_read.html" target="_blank" title="标题">服务费用</a></li>
    </ul>
    </div>
    <div>
    <span><i class="i2"></i>关于我们</span>
    <ul>
     <li><a href="article_read.html" target="_blank" title="标题">招贤纳士</a></li>
     <li><a href="article_read.html" target="_blank" title="标题">网站介绍</a></li>
     <li><a href="article_read.html" target="_blank" title="标题">配送效率</a></li>
     <li><a href="article_read.html" target="_blank" title="标题">商家加盟</a></li>
    </ul>
    </div>
    <div>
    <span><i class="i3"></i>帮助中心</span>
    <ul>
     <li><a href="article_read.html" target="_blank" title="标题">服务内容</a></li>
     <li><a href="article_read.html" target="_blank" title="标题">服务介绍</a></li>
     <li><a href="article_read.html" target="_blank" title="标题">常见问题</a></li>
     <li><a href="article_read.html" target="_blank" title="标题">网站地图</a></li>
    </ul>
    </div>
  </section>
 </section>
<div class="copyright">© 版权所有 2016 王军校 技术支持：<a href="http://www.deathghost.cn" title="王军校">王军校</a></div>
</footer>
</body>
<script type="text/javascript" src="js/header.js"></script>
<script type="text/javascript" src="js/page.js"></script>
<script type="text/javascript">

	function check() {
		var username = document.getElementById("username").value;
		if( username == null || username == "") {
			return false;
		}
		var password = document.getElementById("password").value;
		if( password == null || password == "" || password != 
			document.getElementById("password2").value) {
			return false;
		}
		return true;
	}
	
	function update() {
		
		if(check()) {
			$.ajax({
				cache: true,
				type: "POST",
				url:  "/dingcan/system/saveOrUpdateAppUser.do",
				data: $('#registForm').serialize(),// 你的formid
				async: false,
				error: function(request) {
					alert("注册失败" + request);
				},
				success: function(data) {
					alert(data);
					//	{success:false,msg:'该用户已存在'}
					var i = data.search(/true/i);
					if(i == -1) {
						alert("用户已存在");
					} else  {
						alert("注册成功");
//						$api.setStorage("dingcan_username",$("#name").val())
						localStorage.setItem("dingcan_username",$("#name").val());
						window.location.href = "/dingcan/htmls/login.html";
					}
					
				}
			});
		} else {
			alert("手机号为空或者密码不对");
		}
		
	}
</script>
</html>
